import request from '@/utils/request'

const api = {
  queryReportInspectPageUrl: '/qm_report_inspect/query_report_inspect_page',
  queryStandardDocUrl: '/qm_standard/query_standard',
  queryItemsUrl: '/qm_standard/query_items',
  checkUrl: '/qm_check/check',
  queryCheckHPageUrl: '/qm_check/query_checkh_page',
  queryQmCheckBSUrl: '/qm_check/query_qm_checkbs',
  shoujianReportInspectMoldUrl:
    '/qm_report_inspect/shoujian_report_inspect_mold',
  shoujianReportInspectUrl: '/qm_report_inspect/shoujian_report_inspect',
  lailiaoReportInspectUrl: '/qm_report_inspect/lailiao_report_inspect',
}

export async function lailiaoReportInspectApi(data: Map<string, any>) {
  const res = await request({
    url: api.lailiaoReportInspectUrl,
    method: 'post',
    data,
  })
  return res
}

// 模具报检
export async function shoujianReportInspectMoldApi(data: Map<string, any>) {
  const res = await request({
    url: api.shoujianReportInspectMoldUrl,
    method: 'post',
    data,
  })
  return res
}

// 非模具报检
export async function shoujianReportInspectApi(params: Map<string, any>) {
  const res = await request({
    url: api.shoujianReportInspectUrl,
    method: 'get',
    params,
  })
  return res
}

export async function queryQmCheckBSApi(params: Map<string, any>) {
  const res = await request({
    url: api.queryQmCheckBSUrl,
    method: 'get',
    params,
  })
  return res
}

export async function queryCheckHPageApi(data: Map<string, any>) {
  const res = await request({
    url: api.queryCheckHPageUrl,
    method: 'post',
    data,
  })
  return res
}

export async function checkApi(data: Map<string, any>) {
  const res = await request({
    url: api.checkUrl,
    method: 'post',
    data,
  })
  return res
}

export async function queryItemsApi(params: Map<string, any>) {
  const res = await request({
    url: api.queryItemsUrl,
    method: 'get',
    params,
  })
  return res
}

export async function queryStandardDocApi(params: Map<string, any>) {
  const res = await request({
    url: api.queryStandardDocUrl,
    method: 'get',
    params,
  })
  return res
}

export async function queryReportInspectPageApi(data: Map<string, any>) {
  const res = await request({
    url: api.queryReportInspectPageUrl,
    method: 'post',
    data,
  })
  return res
}
